package org.sws.domain.strategy.service.armory;


import org.sws.domain.strategy.model.valobj.StrategyAwardStockKeyVO;

import java.util.Date;

/**
 * @author joyboy
 * @description 策略抽奖调度
 */
public interface IStrategyDispatch {
    /**
     * 获取抽奖策略装配的随机结果
     * @param strategyId 策略ID
     * @return 奖品id
     */
    Integer getRandomAwardId(Long strategyId);

    /**
     * 获取带规则权重的随机抽奖结果
     * @param strategyId 策略ID
     * @param ruleWeightValue 规则权重值
     * @return 抽奖奖品id
     */
    Integer getRandomAwardId(Long strategyId, String ruleWeightValue);


    /**
     * 根据策略ID和奖品ID，扣减奖品缓存库存
     *
     * @param strategyId      策略ID
     * @param awardId         奖品ID
     * @param activityEndTime 活动结束时间
     * @return 扣减结果
     */
    Boolean subtractionAwardStock(Long strategyId, Integer awardId, Date activityEndTime);

    /**
     * 抽奖奖品 - 设置延时队列
     * @param strategyAwardStockKeyVO 创建队列信息
     */
    void awardStockConsumeSendQueue(StrategyAwardStockKeyVO strategyAwardStockKeyVO);
}
